﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Authorization.Roles;

namespace KelonProud.Administration.Domain.Authorization
{
    public class Role : AbpRole<User>
    {
        public const int MaxDescriptionLength = 5000;

        public Role()
        {
        }

        public Role(int? tenantId, string displayName)
            : base(tenantId, displayName)
        {
        }

        public Role(int? tenantId, string name, string displayName)
            : base(tenantId, name, displayName)
        {
        }

        [StringLength(MaxDescriptionLength)]
        public virtual string Description { get; set; }

        //public virtual int? ParentId { get; set; }

        //[ForeignKey("ParentId")]
        //public virtual Role Parent { get; set; }

        [ForeignKey("RoleId")]
        public virtual ICollection<NavigationRole> Navigations { get; set; }

        [NotMapped]
        public override ICollection<RolePermissionSetting> Permissions { get; set; }
    }
}
